Repository navigation
Conversation
…me decodes and plays its sound instead of aborting at hwopus and auddmg:u Xenoblade Chronicles 2's Switch 2 program (SDK 21.4.4) stopped at boot with abort 0xe15 from nn::codec: SDK 21 decodes Opus through a manager (GetHardwareOpusDecoderManagerWorkBufferSize, Initialize/Finalize, decoders made from it, packets enqueued, an Execute that decodes everything waiting, PCM dequeued, counts and a system event), which the host did not have. Past it, abort 0xa99 from auddmg:u: SDK 21 plays through an OutputStream on a virtual output device (GetDefaultVirtualOutputDevice, OpenOutputStream with float planar or PCM16 frames, Start/Stop/Close/Purge, state, free frame count, Write, gain, statistics), which the host did not have either. hle_codec.c now runs the manager on the SDK's software decoder: an enqueued packet takes an I/O buffer, Execute decodes all waiting packets with DecodeOpusInterleaved (silence and a red line on a failure) and signals the manager's event, Dequeue hands back the 20 ms frame; the existing Finalize/Reset hooks also release a manager decoder. hle_audio.c runs each OutputStream on the host's AudioOut: a write converts the frames to one 16-bit interleaved block, the free frame count follows what was played, the release event fires; 48 kHz only. Checked: t_output_stream (new: the block layout and clamping, 100 ms played in real time with release events, a purge after a stop, the states, a 44.1 kHz open refused) and t_audio; Xenoblade Chronicles 2's Switch 2 program boots past both, through its menus, opening and first battle on the Mac (headless, silent sink: the sound itself has not been heard). Docs: two entries in docs/reference/audio.md, symptom index regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its pitch, without a jump every block Xenoblade Chronicles 2's Switch 2 program sounded an octave low with crackling (voices very deep), heard on the Mac app. WriteOutputStream takes interleaved frames (L, R, L, R), and the host read them as one run per channel, misled by the game's code that zeroes an unfilled tail (main+0xad1684) stepping by a period per channel: each 10 ms block's first half played as left and its second half as right, each at half speed, with a jump at every block. t_output_stream asserted the same wrong layout. The block now keeps the order it is given (float scaled and clamped to 16 bits, PCM16 copied). The PCM16 path has no game behind it; it takes the same layout by reasoning, not measurement. Checked on the same 4-minute route with DM_AUDIO_DUMP: energy above 20 kHz from 16-39 % to 0.00 %, left channel lag-1 autocorrelation from 0.18-0.64 to 0.99+, jumps at block edges from 1.42 times those elsewhere to 1.00, and through the real AudioUnit (muted) 0 underruns in 48,000 device callbacks. By ear on the rebuilt Mac app: sounds right. t_output_stream now checks the interleaved order. Docs: docs/reference/audio.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Landed in 67f1d00 with you credited as co-author, while bringing up Star Fox (same SDK, 21.4.4, Wwise 2024.1): your One change you should know about: Xenoblade Chronicles 2 is not on this Mac, so this has not been run on it. Please retest it on main, and reopen this or file an issue if anything differs. Closing this PR since its contents are on main. |
What and why
Xenoblade Chronicles 2's Switch 2 program (SDK 21.4.4) aborted at boot: 0xe15 in
nn::codec, then 0xa99 fromauddmg:u. SDK 21 decodes Opus through a hardware decoder manager and plays through an OutputStream on a virtual output device, and the host had neither.hle_codec.cruns the manager's calls on the SDK's software decoder;hle_audio.cruns each OutputStream on the host's AudioOut (float planar or PCM16 converted to 16-bit blocks, 48 kHz only). Entries: SDK 21's OutputStream on a virtual output device, SDK 21's hardware Opus decoder manager.Checked
t_output_stream(new) andt_audioindm/host/tests.0400E95004038001v1114112: boots past both aborts, through menus, opening and first battle, with the rest of the stack (its profile PR). Sound: on the Mac app, checked by ear after the layout fix (the first version read the interleaved frames as planar: an octave low, with crackling). Measured withDM_AUDIO_DUMPon a 4-minute route, before and after: energy above 20 kHz 16-39 % to 0.00 %, block-edge jump ratio 1.42 to 1.00, and 0 underruns in 48,000 callbacks of the real AudioUnit (muted). The measurements cover the opening only, no heavier gameplay. The OutputStream's PCM16 path has no game behind it.scripts/regress.py check --quickon Donkey Kong Bananza040074A01BF12000, Fire Emblem Fortune's Weave04007EF01F8AE000and Hello Kitty Party Land01001340271EC000, with all of this work together: PASS (0 newly failing, 0 changed MSL). These are the local builds; none has a route, so the harness ran no boot runs. Its report is from before the rebase on currentmain.Docs
docs/reference/audio.mdentry, andpython3 dm/tools/docs_symptoms.pywas run🤖 Generated with Claude Code